package cn.itsub.sodo.action.interval;

import cn.itsub.sodo.Node;
import cn.itsub.sodo.core.types.Vec2;

/** 
 * Moves a Node object to a parabolic position simulating a jump movement 
 *          by modifying it's position attribute.
*/ 
public class JumpTo extends JumpBy {

    public static JumpTo create(float time, Vec2 pos, float height, int jumps) {
        return new JumpTo(time, pos, height, jumps);
    }

    protected JumpTo(float time, Vec2 pos, float height, int jumps) {
        super(time, pos, height, jumps);
    }

    @Override
    public JumpTo copy() {
        return new JumpTo(duration, delta, height, jumps);
    }

    @Override
    public void start(Node aTarget) {
        super.start(aTarget);
        delta.x -= startPosition.x;
        delta.y -= startPosition.y;
    }
}

